package com.game.service;

import com.game.service.define.RoomConfig;
import com.game.service.socket.SocketServer;
import com.game.service.windows.Client;

import javax.swing.*;
import java.awt.*;
import java.util.concurrent.ThreadLocalRandom;

import static com.game.service.define.RoomConfig.*;

public class Main {


    //http://192.168.31.49:7456/?token=00&uid=18889505&language=zh_tw&liveid=10031&stream=10031_1726740988
    //http://43.133.63.190/h5Game/bigsmall/web-mobile?token=00&uid=10001&language=zh_tw&liveid=10031&stream=10031_1726740988


    //http://134.175.54.227/h5GameTest/bigsmall/web-mobile?token=00&uid=18889054&language=zh_tw&liveid=10031&stream=10031_1726740988
    //http://43.133.63.190/h5GameTest/bigsmall/web-mobile?token=00&uid=18889052&language=zh_tw&liveid=10031&stream=10031_1726740988

    // http://134.175.54.227/h5Game/car-mobile

    // https://www.hhvip888.com/game/userBalance数据{"uid":18889054,"token":"00","liveid":10031,"stream":"10031_1726740988"}

    public static void main(String[] args) {
        final int port = RoomConfig.PORT;
        SocketServer ws = new SocketServer(port);
        ws.start();
        System.out.printf("run()5版本%s,\n版本更新内容:%s,\n服务器地址:%s,  port:%s\n", VERSION, VersionDesc, URL, port);

        //Client.open();


    }

//    private static void test() {
//        int big = 0;
//        int dragon = 0;
//        boolean flag = true;
//        for (int i = 0; i < 20000; i++) {
//            int[] points = random();
//            int a = points[0] + points[1] + points[2];
//            if (a > 10) {
//                big++;
//                dragon++;
//            }else {
//                System.out.println("big-dragon" + dragon);
//                dragon=0;
//
//            }
//
//
//
//        }
//        System.out.println("big" + big);
//    }
//
//    public static int[] random() {
//        int[] points = new int[3];
//        Random random = new Random();
//        int num1 = points[0] = random.nextInt(6) + 1;
//        int num2 = points[1] = random.nextInt(6) + 1;
//        int num3 = points[2] = random.nextInt(6) + 1;
//        int total = num1 + num2 + num3;
//
//        System.out.println("Random numbers: " + num1 + ", " + num2 + ", " + num3 + " ,Total:" + total + " 结果:" + (total > 10 ? "大" : "小"));
//        return points;
//    }

}